#include <iostream>
using namespace std;
#include <iomanip>
void arraycopy(int *src, int *dest, int size);
void display(const int *array, int size);

int main()
{
	int a[] = {1, 2, 3, 4, 5, 6};
	int b[] = {7, 2, 6, 0, 1, 3};//use int b[7]; can also be.
	arraycopy(a, b, sizeof(a)/sizeof(int));
	cout << "The data of a is : " << endl;
	display(a, sizeof(a)/sizeof(int));
	cout << "The data of b is : " << endl;
	display(b, sizeof(b)/sizeof(int));
	return 0;
}

void arraycopy(int *src, int *dest, int size)
{
	for (int i=0; i<size; i++)
	{
		dest[i] = src[i];
	}
}

void display(const int *array, int size)//const protect the pointer to the data.
{
	for (int i=0; i<size; i++)
	{
		cout << setw(2) << array[i];
	}
	cout << endl;
}
